package com.wytec.xywzxw.service.impl;

import java.util.List;
import com.wytec.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wytec.xywzxw.mapper.XwUserMapper;
import com.wytec.xywzxw.domain.XwUser;
import com.wytec.xywzxw.service.IXwUserService;

/**
 * 用户Service业务层处理
 * 
 * @author xywzxw
 * @date 2025-10-28
 */
@Service
public class XwUserServiceImpl implements IXwUserService 
{
    @Autowired
    private XwUserMapper xwUserMapper;

    /**
     * 查询用户
     * 
     * @param id 用户主键
     * @return 用户
     */
    @Override
    public XwUser selectXwUserById(Long id)
    {
        return xwUserMapper.selectXwUserById(id);
    }

    /**
     * 查询用户列表
     * 
     * @param xwUser 用户
     * @return 用户
     */
    @Override
    public List<XwUser> selectXwUserList(XwUser xwUser)
    {
        return xwUserMapper.selectXwUserList(xwUser);
    }

    /**
     * 新增用户
     * 
     * @param xwUser 用户
     * @return 结果
     */
    @Override
    public int insertXwUser(XwUser xwUser)
    {
        xwUser.setCreateTime(DateUtils.getNowDate());
        return xwUserMapper.insertXwUser(xwUser);
    }

    /**
     * 修改用户
     * 
     * @param xwUser 用户
     * @return 结果
     */
    @Override
    public int updateXwUser(XwUser xwUser)
    {
        xwUser.setUpdateTime(DateUtils.getNowDate());
        return xwUserMapper.updateXwUser(xwUser);
    }

    /**
     * 批量删除用户
     * 
     * @param ids 需要删除的用户主键
     * @return 结果
     */
    @Override
    public int deleteXwUserByIds(Long[] ids)
    {
        return xwUserMapper.deleteXwUserByIds(ids);
    }

    /**
     * 删除用户信息
     * 
     * @param id 用户主键
     * @return 结果
     */
    @Override
    public int deleteXwUserById(Long id)
    {
        return xwUserMapper.deleteXwUserById(id);
    }
}
